From: Jonas Dreßler Date: Mon, 24 Jun 2019 08:57:24 +0000 (+0200) Subject: polkitAgent: Only set key focus to password entry after opening dialog X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~463 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=70203b58ca5310313f01cf8ae6719ae9176c68db;p=gnome-shell.git polkitAgent: Only set key focus to password entry after opening dialog Set the key focus to the password field only after we got a request (and therefore know that a password is requested) instead of using `setInitialKeyFocus()`. This way we don't try to focus the password field by default if we aren't showing it (e.g. in case the user has no password or is using fingerprint login). Also we have to move the call to `grab_key_focus()` to happen after `_ensureOpen()`, because otherwise the ModalDialog will set the focus to one of the buttons while opening itself. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788 --- diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 30d04d5c5..2393eff3e 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -103,7 +103,6 @@ var AuthenticationDialog = GObject.registerClass({ this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true); this._passwordBox.add(this._workSpinner); - this.setInitialKeyFocus(this._passwordEntry); this._passwordBox.hide(); this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' }); @@ -260,9 +259,10 @@ var AuthenticationDialog = GObject.registerClass({ this._passwordBox.show(); this._passwordEntry.set_text(''); - this._passwordEntry.grab_key_focus(); this._updateSensitivity(true); + this._ensureOpen(); + this._passwordEntry.grab_key_focus(); } _onSessionShowError(session, text) {